<template>
  <n-result status="500" title="500 服务器错误" :description="error.message">
    <template #footer>
      <n-button type="warning" @click="handleError">返回首页</n-button>
    </template>
  </n-result>
</template>

<script lang="ts" setup>
import { NButton, NResult } from "naive-ui";
type errorType = { message: string | undefined };
defineProps<{ error: errorType }>();

const handleError = () => clearError({ redirect: "/" });
</script>
